package jmine.tec.web.wicket.model;

import java.util.Date;

import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;

/**
 * PropertyModel do tec date.
 * 
 * @author wagner
 */
public class TecDatePropertyModel implements IModel<Date> {

    private PropertyModel<bancosys.tec.utils.date.Date> model;

    /**
     * C' tor
     * 
     * @param modelObject modelObject
     * @param expression expressão.
     */
    public TecDatePropertyModel(Object modelObject, String expression) {
        this.model = new PropertyModel<bancosys.tec.utils.date.Date>(modelObject, expression);
    }

    /**
     * {@inheritDoc}
     */
    public Date getObject() {
        return this.model.getObject();
    }

    /**
     * {@inheritDoc}
     */
    public void setObject(Date object) {
        this.model.setObject(object == null ? null : new bancosys.tec.utils.date.Date(object));
    }

    /**
     * {@inheritDoc}
     */
    public void detach() {

    }

}
